package customF;

/**
 * Created with IntelliJ IDEA.
 * ClassName: Person
 * Package: customF
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-09-04
 * Time: 21:22
 */

//加了这个泛型参数 就已经是一个泛型类了
public class Person <T>{

    //声明了类的泛型参数以后，就可以在类的内部使用此泛型参数

    T t;
    int id;

    public Person(){}

    public Person(T t, int id) {
        this.t = t;
        this.id = id;
    }

    public T getT() {
        return t;
    }

    public void setT(T t) {
        this.t = t;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "Person{" +
                "t=" + t +
                ", id=" + id +
                '}';
    }
}
